package com.kyh.enume.sys;

import com.kyh.enume.sys.MenuEnum.Lev;
import com.kyh.enume.sys.MenuEnum.ShowCount;
import com.kyh.enume.sys.MenuEnum.TypeTemplet;

public class MenuEnum {
	
	/**
	 * 菜单级别
	 */
	public enum Lev {
		ONE("一级菜单", 1), TWO("二级菜单", 2);
		public String name;
		public Integer value;

		private Lev(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (Lev e : Lev.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
	
	/**
	 * 模板类型
	 */
	public enum TypeTemplet {
		LIST_NORMAL("普通列表", 1), TREE_WITH_LIST("树+列表", 2), TREE_WITH_CHECKBOX("树+复选框", 3),
		UP_AND_DOWN("上下列表", 4), DIY("自定义", 5), LIST_SINGLE("单列表", 6);
		public String name;
		public Integer value;

		private TypeTemplet(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (TypeTemplet e : TypeTemplet.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
	
	/**
	 * 菜单是否显示统计
	 */
	public enum ShowCount {
		YES("是", 1), NO("否", 2);
		public String name;
		public Integer value;

		private ShowCount(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (ShowCount e : ShowCount.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
}
